class Solution {
public:
    int diagonalSum(vector<vector<int>>& mat) {
    int result=0;
    for(int i=0,j=mat.size()-1;i<mat[0].size()&&j>=0;i++,j--)
    {
        int scc=0;
       if(i==j){
           scc=mat[i][i];
       }
        result=mat[i][i]+mat[j][i]+result-scc;
    }
    return result;
    }
};